package com.csun.cmny.provider.service.impl;

import com.csun.cmny.core.support.BaseService;
import com.csun.cmny.provider.dao.DmcGatewayDataHiMapper;
import com.csun.cmny.provider.model.domain.DmcGatewayDataHi;
import com.csun.cmny.provider.model.dto.gateway.GatewayDataHiPageQuery;
import com.csun.cmny.provider.service.DmcGatewayDataHiService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Auther: chisj chisj@foxmal.com
 * @Date: 2019-01-16 14:05
 * @Description: the dmc gateway data hi service impl
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class DmcGatewayDataHiServiceImpl extends BaseService<DmcGatewayDataHi> implements DmcGatewayDataHiService {

    @Resource
    private DmcGatewayDataHiMapper gatewayDataHiDao;

    /**
     * query dmc gateway data hi list with page
     *
     * @param gatewayDataHiPageQuery the gate data hi query page
     *
     * @return the page info
     */
    @Override
    public PageInfo queryDmcGatewayDataHiListWithPage(GatewayDataHiPageQuery gatewayDataHiPageQuery) {

        PageHelper.startPage(gatewayDataHiPageQuery.getPageNum(), gatewayDataHiPageQuery.getPageSize());

        List<DmcGatewayDataHi> dmcGatewayDataHiList = gatewayDataHiDao.queryDmcGatewayDataHiListWithPage(gatewayDataHiPageQuery);

        return new PageInfo<>(dmcGatewayDataHiList);
    }
}
